home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 June
/
Macworld (1999-06).dmg
/
Shareware World
/
Info
/
For Developers
/
MacZoop2.0.sea
/
MacZoop2.0
/
Required Classes
/
ZClipboard.h
< prev
next >
Wrap
Text File
|
1998-05-04
|
2KB
|
101 lines
/*************************************************************************************************
*
*
* MacZoop - "the framework for the rest of us"
*
*
*
* ZClipboard.h -- the clipboard object
*
*
*
*
*
* © 1997, Graham Cox
*
*
*
*
*************************************************************************************************/
#pragma once
#ifndef __ZCLIPBOARD__
#define __ZCLIPBOARD__
#ifndef __ZCOMRADE__
#include "ZComrade.h"
#endif
class ZClipboard;
extern ZClipboard* gClipboard;
DEFINECLASSID( ZClipboard, 'zclp' );
// class def:
class ZClipboard : public ZComrade
{
public:
ZClipboard() : ZComrade() { classID = CLASS_ZClipboard; gClipboard = this; };
~ZClipboard() {};
// putting data on the clipboard
virtual void PutData( OSType dataType, Handle someData );
virtual void PutData( OSType dataType, Ptr dataPtr, const long dataLen );
virtual void PutData( PicHandle aPicture );
virtual void PutText( Handle textH );
virtual void PutText( Ptr charBuf, const long textLen );
virtual void AppendData( OSType dataType, Handle someData );
virtual void AppendData( OSType dataType, Ptr dataPtr, const long dataLen );
virtual void AppendData( PicHandle aPicture );
virtual void AppendText( Handle textH );
virtual void AppendText( Ptr charBuf, const long textLen );
// clearing the clipboard
virtual void Clear();
// getting data and info
virtual Handle GetData( OSType dataType );
virtual Boolean QueryType( OSType dataType );
virtual long GetDataSize( OSType dataType );
virtual short GetClipStatus();
// private scrap conversion
virtual void ConvertFromPrivate() {};
virtual void ConvertToPrivate() {};
// multi-data handling stuff
virtual short CountTypes();
virtual OSType GetIndType( const short index );
protected:
Boolean GetWildcardType( OSType* aType );
};
// this object is a "wrapper" for clipboard storage ops. This class implements its behaviour
// using the standard desk scrap. You can subclass it for private scrap schemes.
// pass this in any type parameter to obtain ANY data from the scrap, regardless oftype:
enum
{
Wild_Card = '????'
};
// ZClipboard transmits the following messages to is comrades:
enum
{
clipContentsChanged = 'clp1',
clipContentsAppended,
clipContentsCleared,
clipDataConverted
};
// hint: these can be used to inform a "clipboard window" to update itself.
#endif